<#include "/includes/son.ftl">
<script>
    $(function () {
        $("#doSub").click(function () {
           const oldPwd =  $("#oldpwd").val();
           const newPwd = $("#newpwd").val();
           const confirmPwd =  $("#confirmpwd").val();
            /**
             * 校验
             */
            if (newPwd !== confirmPwd){
                lightyear.notify("确认密码要与新密码保持一致",'danger',100);
                return;
            }
            $.post('/admin/shopAdminPage/doEditPass',{oldpwd: oldPwd,newpwd: newPwd},
            function (data) {
                if (data.status === 200){
                    lightyear.notify(data.data,'success',100);
                    window.location.href = 'admin/shopAdmin/doLogout'
                }else {
                    lightyear.notify(data.data,'danger',100);
                }
            })
        })
    });
</script>
<div class="container-fluid" style="margin-top: 15px">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">


                        <div class="form-group">
                            <label for="old-password">旧密码</label>
                            <input type="password" class="form-control" name="oldpwd" id="oldpwd" placeholder="输入账号的原登录密码">
                        </div>
                        <div class="form-group">
                            <label for="new-password">新密码</label>
                            <input type="password" class="form-control" name="newpwd" id="newpwd" placeholder="输入新的密码">
                        </div>
                        <div class="form-group">
                            <label for="confirm-password">确认新密码</label>
                            <input type="password" class="form-control" name="confirmpwd" id="confirmpwd" placeholder="请输入新的密码">
                        </div>

                     <input id="doSub" type="button" class="btn btn-primary" value="修改密码">
                </div>
            </div>
        </div>

    </div>

</div>
